import java.util.ArrayList;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LENOVO
 * Date: 2024-08-06
 * Time: 15:20
 */
public class Test {
    public static void main(String[] args) {
        ArrayList<Character> list = new ArrayList<>();
        String sentence = " Welcome to bit ";
        String deleteLetter = "come";
        int size = 0;
        for (int i = 0; i < sentence.length(); i++) {
            if(! deleteLetter.contains(sentence.charAt(i)+"") ){
                list.add(sentence.charAt(i));
                size++;
            }
        }
        for (int i = 0; i < size; i++) {
            System.out.print(list.get(i) + " ");
        }
        System.out.println();
    }
}
